package com.xiaoyu.base.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import com.xiaoyu.base.entity.UserEntity;

import java.util.List;

import static androidx.room.OnConflictStrategy.REPLACE;

@Dao
public interface UserDao {

    String LOG_TAG = "lib-dao";

    @Insert(onConflict = REPLACE)
    void upsert(UserEntity entity);

    @Insert(onConflict = REPLACE)
    void upsertList(List<UserEntity> entityList);

    @Query("SELECT * From user WHERE uid = :uid LIMIT 1")
    UserEntity getUserByUid(String uid);
}
